<?php

namespace app\validate;

use app\base\BaseValidate;

/**
 * 验证器-AgencyArticleValidate
 * Class AgencyArticleValidate
 * @package app\validate
 */
class AgencyArticleValidate extends BaseValidate
{
	
    protected $rule = [
        'id' => 'require|number',
        'title|标题 ' => 'require',
        'content|内容' => 'require',
        'status|状态' => 'require|in:1,2'
    ];


    //验证场景-上线状态
    public function sceneUpStatus()
    {
        return $this->only(['id', 'status']);
    }

    //验证场景-保存
    public function sceneSave()
    {
        return $this->only([
            'id',
            'title',
            'img',
            'intro',
            'content',
            'status',
            'sort'
        ]);
    }
}
